package com.example.common.domain.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.common.enums.UserRole;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;
import java.sql.Timestamp;


@Data
@AllArgsConstructor
@Entity
@TableName("users") // 确保和数据库表名一致
public class User  {
    @Id
    @TableId(type = IdType.ASSIGN_UUID)
    private String id;
    private String username;
    private String password;
    private UserRole role;

    private String phone;
    private String imgUrl;

    private Integer deleted; // 0:未删除, 1:已删除
    private Timestamp created_at;

    public User(String id) {
        this.id = id;
    }

    public User() {

    }
}
